// 定义购物车相关的接口
import instance from "@/utils/request";

// 获取购物车数据接口
export function getcartlistdata() {
    return instance({
        url: '/cart/index',
        method: 'get',
    })
}

// 定义单选和全选接口
interface checkedparams {
    isChecked: string,
    productIds: string
}
export function setcheckedproduct(data: checkedparams) {
    return instance({
        url: '/cart/checked',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}

// 定义删除商品的接口
export function delcartapi(data: { productIds: string }) {
    return instance({
        url: '/cart/delete',
        method: 'post',
        data,
        headers: {
            'Content-Type': 'application/json'
        }
    })
}
